import Vue from 'vue';
import router from '../router';
import state from './state';
// import vue_state from "./state";

const $this = Vue.prototype;
export default {
    set_token(state, data) {
        state.token = data;
        localStorage.setItem('token',data)
    },
    set_userInfo(state, data) {
        state.userInfo = data
        this.commit('set_localStorage',{key:'userInfo',data})
    },
    set_student_id(state,data){
        state.student_id = data
        localStorage.setItem('student_id',data)
    },
    set_company_id(state, data) {
        state.company_id = data
        this.commit('set_localStorage',{key:'company_id',data})
    },
    set_configInfo(state, data) {
        console.log(state,data,333333)
        state.configInfo = data
        this.commit('set_localStorage',{key:'configInfo',data})
    },
    set_flootInfo(state, data) {
        state.flootInfo = data
        this.commit('set_localStorage',{key:'flootInfo',data})
    },
    set_localStorage(state,{key,data}){
        localStorage.setItem(key,JSON.stringify(data))
    }
  
}
